package com.atguigu.spring.facbean;

import com.atguigu.spring.entity.Course;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author yanglin
 * @create 2023-12-11 16:02 星期一
 * description:
 */
public class MyFactoryBean implements FactoryBean {

    /**
     * 定义返回Bean
     * @return
     * @throws Exception
     */
    @Override
    public Course getObject() throws Exception {
        Course course = new Course();
        course.setCname("化学");
        return course;
    }

    @Override
    public Class<?> getObjectType() {
        return null;
    }

    @Override
    public boolean isSingleton() {
        return false;
    }
}
